# -------------------------------------------------------------------
#       -*- coding: utf-8 -*-
#   @Project    :   spider
#   @File       :   11_urlopen.py
#   @Author     :   WANGYU
#   @Time       :   2021-08-16 11:49:25
#   @Software   :   PyCharm
#   @Desc       :   re解析
# -------------------------------------------------------------------
from urllib.request import urlopen

url = 'http://www.baidu.com'
resp = urlopen(url)

# print(resp.read().decode('utf-8'))

with open('11_baidu.html', 'w', encoding='utf-8') as file:
    file.write(resp.read().decode('utf-8'))
print('over')
